int a[27];
main()
{
    int i, n, j=1;
    a[1]=1;
    printf("The original order of cards is (r:rad b:block) :\n");
    for (i=2; i<=26; i++)
    {
        n=1;
        do 
        {
            if (j>26) j = 1;
        if (a[j]) j++;
        else
        {
            if (n==3) a[j]=i;
            j++; n++;
        }
        } while (n<=3);
    }
    for ( i = 1; i <=26; i++)
    {
        printf("%c ",a[i]>13 ?'r':'b');
        printf("%2d \n",a[i]>13 ? a[i]-13 : a[i]);
    }
    printf("\n");
}